package com.jet.chat.message;

import java.io.PrintWriter;

import com.jet.chat.exception.ChatException;

public class MessageWriterPrintWriter implements MessageWriter {
	
	PrintWriter writer;
	
	public MessageWriterPrintWriter(PrintWriter writer) {
		this.writer = writer;
	}

	@Override
	public void write(Message message) {
		writer.println(message.getContent());
		writer.flush();
	}

	@Override
	public void write(String string) throws ChatException {
		writer.println(string);
		writer.flush();
	}

}
